package classtrait

/**
 *
 * @author tzp
 * @since 2021/1/16
 */

class Dog extends FirstTrait {
  override def oo(in: Int): String = "??/" + in
}

object Dog {
  def main(args: Array[String]): Unit = {
    val x = new Dog
    println(x.oo(1))
    println(x.xx(1))
  }
}

trait FirstTrait {
  var inner: Int = 0

  def oo(in: Int): String

  def xx(in: Int): String = {
    inner = in
    "xx/" + in.toString
  }
}

trait SecondTrait extends AnyRef with FirstTrait {
  //trait SecondTrait extends FirstTrait {
  def ooWrap(in: Int): String = {
    "{" + oo(in) + "}"
  }
}



